var util = require('util');
var EventEmitter = require('events');

function MyStream() {
  EventEmitter.call(this);
}

util.inherits(MyStream, EventEmitter);

MyStream.prototype.push = function(trunk) {
  this.emit('buffer', trunk);
}

var stream = new MyStream();

console.log(stream instanceof EventEmitter);
console.log(MyStream.super_ === EventEmitter);


stream.on('buffer', function(trunk) {
  console.log('This is amazing and I received data: ' + trunk);
});


stream.push('abcdefg');